package com.chy.算法;

import java.util.concurrent.CountDownLatch;

public class mn_00 {

    private static int count;

    public static int method(int m,int n){
        if(m <= 0 && n <= 0){
            return 0;
        }else if (m == 0 || n == 0){
            //这样就返回是因为一边为0，那么只剩一条路可走
            return 1;
        }else {
            return method(m,n-1) + method(m-1,n);
        }
    }

    public static void method2(int m,int n){
        if(m <= 0 && n <= 0){
            return ;
        }else if (m == 0 || n == 0){
            count++;
            return ;
        }else {
            method2(m,n-1);
            method2(m-1,n);
        }
    }
    public static void main(String[] args) {
        System.out.println(method(13, 2));
        method2(2,13);
        System.out.println(count);
    }
}
